$(function() {
	var app = new Vue({
		el: '#app',
		data: {
			Language: {}, //语言包
			mylist: {
				result: {
					list: ""
				}
			} //我的优惠券列表
		},
		methods: {
			Langes: function(v) {
				$.ajax({
					type: "get",
					dataType: "json",
					url: "../Langue/" + v + ".json",
					success: function(h) {
						app.Language = h;
					},
					error: function(e) {
						console.log("错误");
					}
				});
			},
			content: function() {
				let data = {};
				data.type = 2; //1:表示正常 2:表示失效
				data.page = 1;//页数
				common_ajax("get_my_coupon_list",data,"",function(h){
					app.mylist = h;
				});
			},
			del: function(ev, dat) {
				let data = {};
				data.id = dat;
				common_ajax("del_my_coupon",data,"",function(h){
					console.log(h);//查看删除结果
				})
			}
		}
	})
	//首次加载语言
	if(localStorage.getItem("lanuage")) {
		app.Langes(localStorage.getItem("lanuage"));
	} else {
		app.Langes("en");
	}
	//删除全部失效优惠券
	$(".mui-pull-right").click(function() {
		$(".draw").remove();
	})
})